package ar.edu.utn.frgp.EjemploHibernate.actions;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import ar.edu.utn.frgp.EjemploHibernate.model.Tester;
import ar.edu.utn.frgp.EjemploHibernate.service.IRecursoService;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class TesterListarAction extends ActionSupport implements ModelDriven<Tester> {

	@Autowired
	private IRecursoService recursoService;

	private List<Tester> tester = new ArrayList<Tester>();

	private static final long serialVersionUID = 1L;

	public List<Tester> getTester() {
		return tester;
	}

	public void setClientes(List<Tester> tester) {
		this.tester = tester;
	}

	@Override
	public String execute() throws Exception {
		/*
		 * esto devuelve un listado de todos los testers que se muestran en la
		 * jsp con un iterator
		 */

		tester = recursoService.getTester();
		return SUCCESS;
	}

	public Tester getModel() {
		return null;
	}
}
